package tmp;

// Generated 04-nov-2009 18:40:40 by Hibernate Tools 3.2.4.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Service generated by hbm2java
 */
@Entity
@Table(name = "service", catalog = "fmanzano_gem", uniqueConstraints = {
		@UniqueConstraint(columnNames = "SER_NAME"),
		@UniqueConstraint(columnNames = { "SER_ID", "SEG_ID" }) })
public class Service implements java.io.Serializable {

	private Integer serId;
	private ServiceGroup serviceGroup;
	private boolean serActive;
	private String serComments;
	private boolean serEditable;
	private String serMode;
	private String serName;
	private Set<ServiceOption> serviceOptions = new HashSet<ServiceOption>(0);
	private Set<Profile> profiles = new HashSet<Profile>(0);

	public Service() {
	}

	public Service(ServiceGroup serviceGroup, boolean serActive,
			boolean serEditable, String serMode, String serName) {
		this.serviceGroup = serviceGroup;
		this.serActive = serActive;
		this.serEditable = serEditable;
		this.serMode = serMode;
		this.serName = serName;
	}

	public Service(ServiceGroup serviceGroup, boolean serActive,
			String serComments, boolean serEditable, String serMode,
			String serName, Set<ServiceOption> serviceOptions,
			Set<Profile> profiles) {
		this.serviceGroup = serviceGroup;
		this.serActive = serActive;
		this.serComments = serComments;
		this.serEditable = serEditable;
		this.serMode = serMode;
		this.serName = serName;
		this.serviceOptions = serviceOptions;
		this.profiles = profiles;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "SER_ID", unique = true, nullable = false)
	public Integer getSerId() {
		return this.serId;
	}

	public void setSerId(Integer serId) {
		this.serId = serId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SEG_ID", nullable = false)
	public ServiceGroup getServiceGroup() {
		return this.serviceGroup;
	}

	public void setServiceGroup(ServiceGroup serviceGroup) {
		this.serviceGroup = serviceGroup;
	}

	@Column(name = "SER_ACTIVE", nullable = false)
	public boolean isSerActive() {
		return this.serActive;
	}

	public void setSerActive(boolean serActive) {
		this.serActive = serActive;
	}

	@Column(name = "SER_COMMENTS", length = 100)
	public String getSerComments() {
		return this.serComments;
	}

	public void setSerComments(String serComments) {
		this.serComments = serComments;
	}

	@Column(name = "SER_EDITABLE", nullable = false)
	public boolean isSerEditable() {
		return this.serEditable;
	}

	public void setSerEditable(boolean serEditable) {
		this.serEditable = serEditable;
	}

	@Column(name = "SER_MODE", nullable = false)
	public String getSerMode() {
		return this.serMode;
	}

	public void setSerMode(String serMode) {
		this.serMode = serMode;
	}

	@Column(name = "SER_NAME", unique = true, nullable = false, length = 30)
	public String getSerName() {
		return this.serName;
	}

	public void setSerName(String serName) {
		this.serName = serName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "service")
	public Set<ServiceOption> getServiceOptions() {
		return this.serviceOptions;
	}

	public void setServiceOptions(Set<ServiceOption> serviceOptions) {
		this.serviceOptions = serviceOptions;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "services")
	public Set<Profile> getProfiles() {
		return this.profiles;
	}

	public void setProfiles(Set<Profile> profiles) {
		this.profiles = profiles;
	}

}
